package com.example.a2205douyin.live;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.example.a2205douyin.R;

public class BaoLayout extends LinearLayout {
    TextView tv;
    ImageView iv;

    public BaoLayout(Context context) {
        super(context);
    }

    public BaoLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        View view = LayoutInflater.from(context).inflate(R.layout.gift_baoji, null);
        tv = view.findViewById(R.id.tv);
        iv = view.findViewById(R.id.iv);
        addView(view);
    }

    public BaoLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public BaoLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }
    public void load(String url,int count){
        Glide.with(getContext()).load(url).into(iv);
        tv.setText("X "+count);
    }
}
